﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpModelInterface.h"
#include "IDbObject.h"

namespace gcmp
{
    enum class BaseUnit;

    /// \brief 单位量纲
    class GCMP_MODEL_INTERFACE_EXPORT IUnitDimension : public IDbObject
    {
        DEFINE_CAST_DERIVED(gcmp::IUnitDimension, gcmp::IDbObject);

    public:

        /// \brief 创建单位量纲
        ///
        /// \return 单位量纲
        static OwnerPtr<IUnitDimension> Create();

        /// \brief 复制单位量纲
        ///
        /// \return 单位量纲
        virtual OwnerPtr<IUnitDimension> Clone() const = 0;

        /// \brief 获取基本单位对应的指数
        ///
        /// \param baseUnit 基本单位类型
        /// \return 指数
        virtual int GetExponent(BaseUnit baseUnit) const = 0;

        /// \brief 设置基本单位对应的指数
        ///
        /// \param baseUnit 基本单位类型
        /// \param exponent 指数
        /// \return 单位量纲
        virtual IUnitDimension& SetExponent(BaseUnit baseUnit, int exponent) = 0;

        /// \brief 判断量纲是否相等
        ///
        /// \param pUnitDimension 另一个单位量纲
        /// \return bool true-相等，false-不相等
        virtual bool Equals(const IUnitDimension* pUnitDimension) const = 0;
    };
}

